<template>
    <div>
        <user-sub-nav 
        :subNavTitle="subNavTitle"
        :activeUrl="activeUrl"
        @activeHandler="activeHandler"
        />
        <router-view/>
    </div>
</template>

<script>
import userSubNav from '@/components/userSubNav';
    export default {
         components:{userSubNav},
         data() {
            return {
                subNavTitle:[
                    {
                        title : '推荐',
                        url : 'recommend'
                    },
                    {
                        title : '排行榜',
                        url : 'rankingList'
                    },
                    {
                        title:'歌单',
                        url : 'songList'
                    },
                    {
                        title : '主播电台',
                        url : 'anchorStation'
                    },
                    {
                        title : '歌手',
                        url : 'singer'
                    },
                    {
                        title : '新碟上架',
                        url : 'newDisc'
                    }
                ],
                activeUrl:'recommend'
            }
         },
         methods:{
            activeHandler(url){
                this.activeUrl = url ;
                const path = this.$route.matched[0].path
                this.$router.push(`${path}/${url}`)
            }
         },
         mounted(){
         }
    }
</script>

<style lang="scss" scoped>

</style>